﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CSCore.SoundIn;
using CSCore.SoundOut;
using FM.Services;
using FM.录音.Data;
using FM.录音.Services;
using Microsoft.Practices.ObjectBuilder2;
using Microsoft.Practices.Prism.Mvvm;

namespace FM.录音.ViewModels
{
    public class 系统配置视图ViewModel : Vm基类<系统配置>
    {
        private string _录音声卡;
        private string _播放声卡;
        private ObservableCollection<string> _输入声卡list;
        private ObservableCollection<string> _输出声卡list;

        public 系统配置视图ViewModel()
        {
            //Model = 运行状态.系统配置1;
            输入声卡list = new ObservableCollection<string>();
            输出声卡list = new ObservableCollection<string>();
            初始化();

        }

        private void 初始化()
        {
            //var inList = 声卡设备.所有输入声卡();
            //var outList = 声卡设备.所有输出声卡();
            //inList.ForEach(x => { 输入声卡list.Add(x.FriendlyName); });
            //outList.ForEach(x => { 输出声卡list.Add(x.FriendlyName); });



            //foreach (var device in inList)
            //{
            //    输入声卡list.Add(device.FriendlyName);
            //}
            //foreach (var device in outList)
            //{
            //    输出声卡list.Add(device.FriendlyName); 
            //}
        }

        public ObservableCollection<string> 输入声卡list
        {
            get { return _输入声卡list; }
            set { SetProperty(ref _输入声卡list, value); }
        }

        public ObservableCollection<string> 输出声卡list
        {
            get { return _输出声卡list; }
            set { SetProperty(ref _输出声卡list, value); }

        }

        public string 录音声卡
        {
            get { return _录音声卡; }
            set { SetProperty(ref _录音声卡, value); }
        }

        public string 播放声卡
        {
            get { return _播放声卡; }
            set { SetProperty(ref _播放声卡, value); }
        }
    }
}